#!/bin/bash

HOSTNAME=$1
IP_ADDR=$2

CARD_NAME=`nmcli connection show | awk 'NR==2{print $1}'`
NET_NAME=${IP_ADDR%.*}

hostnamectl set-hostname $HOSTNMAE
nmcli connection modfity $CARD_NAME ipv4.methmod manual ipv4.addresses $IP_ADDR/24 ipv4.gateway $NET_NAME.254 ipv4.dns $NET_NAME.254 autoconnect yes
nmcli connection up $CARD_NAME

mkdir /mnt/dvd
mount /dev/cdrom /mnt/dvd
rm -rf /etc/yum.repos.d/*
echo "[development]
baseurl=file:///mnt/dvd
gpgcheck=0" > /etc/yum.repos.d/local.repo

yum -y install vim bash-complate